Skip to content

Keep each thread's last tool activity, and clear activity logs on logout - #2

Open
luqeckr-tech wants to merge 1 commit into
LLMNetOps:uifrom
luqeckr-tech:dev/luqe
Open

luqeckr-tech wants to merge 1 commit into
LLMNetOps:uifrom
luqeckr-tech:dev/luqe

Conversation

@luqeckr-tech

Copy link
Copy Markdown

Summary

Tool Activity per thread. The Tool Activity panel was one global list, emptied on every thread switch, New Thread and re-attach, so the commands used in a thread's last turn could not be reviewed afterwards.

  • Each thread now keeps its last turn's tool calls in localStorage (llmnetops-tools-v1, max 30 threads), same pattern as the process console. A new send/re-attach replaces it.
  • The panel shows "Giliran terakhir: …" with the question those calls answered.
  • New states: STOPPED for calls cut off by Stop (previously shown as DONE), TERPUTUS for calls left running when the operator switches threads or closes the page, with an "incomplete" note. Re-attaching to a run that is still going replays it in full.
  • Deleting a thread also deletes its stored tool activity.
  • S.toolCount removed; it always equalled S.tools.length.

Activity logs no longer outlive the session. Tool Activity and the process console both hold tool arguments verbatim (router commands, hosts, possibly secrets), and nothing cleared them.

  • Logout removes both logs (plus the stale llmnetops-console-v2). The chat screen stops persisting until reload, so a run still streaming cannot write them back.
  • Expired session / different user: the username the logs belong to is recorded; logging in (or booting with a live session) as a different user clears them, in storage and in the copy chat.js already hydrated at module load. Logs with no recorded owner (written before this change) are cleared once.
  • Settings (backend, client name, profile) and the legacy pre-manager thread keys are kept.

Not in this PR

  • index.html loads cdn.tailwindcss.com unpinned and without SRI, and nginx sets no CSP, so third-party JS on the origin can read localStorage. Worth a separate PR.
  • Tool activity is per browser; other operators on a shared NetOps thread don't see it. Sharing it would need storage in the manager DB.

Testing

  • node --check on all changed files.
  • Node smoke test with a mocked localStorage importing the real modules: same user keeps logs, different user clears them, unknown owner clears them.
  • Not yet tested in a browser. Please check: thread switch / New Thread / Stop keep the list; leaving a running NetOps thread shows TERPUTUS; logout and login as another user empty both panels.

🤖 Generated with Claude Code

Tool Activity was a single global list, wiped on every thread switch, new
thread and re-attach, so the commands of a thread's last turn could not be
reviewed afterwards. It is now stored per thread in localStorage, like the
process console, together with the question it answered. Calls cut off by
Stop show STOPPED instead of DONE; calls left running when the operator
switches threads or closes the page show TERPUTUS and mark the list
incomplete (re-attaching to a run still in progress replays it in full).

Both logs hold tool arguments verbatim, so they no longer outlive the
session on a shared browser: logout removes them, and logging in as a
different user than the one who wrote them (e.g. after a session expired)
clears them, in storage and in the copy already loaded by the chat screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant